home *** CD-ROM | disk | FTP | other *** search
- /* %filename% */
- /* Created %date% %time% by AppMaker */
-
- #include <Types.h>
- #include <Quickdraw.h>
- #include <Controls.h>
- #include <Dialogs.h>
- #include <Events.h>
- #include <Lists.h>
- #include <Menus.h>
- #include <Resources.h>
- #include <TextEdit.h>
- #include <ToolUtils.h>
- #include "ResourceDefs.h"
- #include "Globals.h"
- #include "Miscellany.h"
- #include "Scrolling.h"
- #include "WindowAids.h"
- #include "%appName%Data.h"
- #include "%windname%.h"
-
- %for each item gen itemNr%
-
- %if lang = MPW%
- #pragma segment %windname%
-
- %end if%
- %for each item gen winAuxiliaryProto%
-
- %for each item gen winAuxiliary%
- /*----------*/
- void Open%WindName%% %(Str255 fName,
- short vRefNum,
- short fRefNum)
- {
- WindowPtr newWindow;
- Rect bounds;
-
- %if lang = MPW%
- #pragma unused (bounds)
-
- %end if%
- newWindow = GetWindow (%windname%ID);
- if (fName [0] != 0) {
- SetWTitle (newWindow, fName);
- }
- SetPort (newWindow);
- SetNewInfo (newWindow);
- %if has vScroll%
- cur->vScroll = GetNewControl (%cntlID%, newWindow);
- %else%
- cur->vScroll = nil;
- %end if%
- %if has hScroll%
- cur->hScroll = GetNewControl (%cntlID%, newWindow);
- %else%
- cur->hScroll = nil;
- %end if%
- cur->fileNum = fRefNum;
- cur->volNum = vRefNum;
- cur->dirty = false;
- cur->filename = NewString (fName);
- cur->windowKind = W%WindName%;
- ((WindowPeek) curWindow)->windowKind = userKind + W%WindName%;
- cur->witlHandle = GetResource ('Witl', %WindName%ID);
- cur->wictHandle = GetResource ('Wict', %WindName%ID);
-
- %push firstEdit%
- %for each item gen create%
-
- %if not firstEdit = %
- cur->text = cur->%firstEdit%;
- %else%
- cur->text = nil;
- %end if%
- %pop firstEdit%
-
- %if firstWindow%
- ShowWindow (newWindow);
- %endif%
-
- } /*Open%WindName%*/
-
- /*----------*/
- void Close%WindName% (void)
- {
- %for each item gen dispose%
-
- DisposHandle ((Handle) cur->filename);
- DiscardInfo (curWindow);
- } /*Close%WindName%*/
-
- /*----------*/
- void Control%WindName% (ControlHandle whichControl,
- short whichPart,
- Point where)
- {
- Rect bounds;
-
- %if lang = MPW%
- #pragma unused (whichControl, whichPart, where, bounds)
-
- %end if%
- %for each item gen track%
-
- } /*Control%WindName%*/
-
- /*----------*/
- void MouseIn%WindName%% %(Point where,
- short modifiers)
- {
- Rect bounds;
-
- %if lang = MPW%
- #pragma unused (where, modifiers, bounds)
-
- %end if%
- %for each item gen mousein%
-
- } /*MouseIn%WindName%*/
-
- /*----------*/
- void TypeIn%WindName% (char ch)
- {
- if (cur->text == nil) {
- SysBeep (1);
- } else {
- TEKey (ch, cur->text);
- cur->dirty = true;
- }
- } /*TypeIn%WindName%*/
-
- /*----------*/
- void Update%WindName% (void)
- {
- Rect bounds;
-
- %if lang = MPW%
- #pragma unused (bounds)
-
- %end if%
- %for each item gen update%
-
- %if has growBox%
- DrawClippedGrow (-15, -15);
- %end if%
- } /*Update%WindName%*/
-
- /*----------*/
- void Activate%WindName% (Boolean activate)
- {
- %if lang = MPW%
- #pragma unused (activate)
-
- %end if%
- %for each item gen activate%
-
- %if has growBox%
- DrawClippedGrow (-15, -15);
- %end if%
- } /*Activate%WindName%*/
-
- /*----------*/
- void Resize%WindName% (void)
- {
- /* application-specific code to resize items in window */
- } /*Resize%WindName%*/
-
- /*----------*/
- pascal void Scroll%WindName%% %(short newValue,
- short oldValue)
- {
- %if lang = MPW%
- #pragma unused (newValue, oldValue)
-
- %end if%
- /* application-specific code to scroll window */
- } /*Scroll%WindName%*/
-
- /* %windname% */
-